package com.net.framework.help.utils;

import android.content.Context;
import android.text.Html;
import android.text.Spanned;

import com.net.framework.help.application.BaseApplication;

public class KCStringUtils {
    /*----------设置黑色字体-----------------*/
    public static Spanned getHtmlBlackSpanned(String paramString) {
        return getHtmlSpanned(paramString, "#333333");
    }

    public static Spanned getHtmlBlackSpanned(int paramInt, String paramString) {
        return getHtmlSpanned(paramInt, paramString, "#333333");
    }

    public static Spanned getHtmlBlackSpanned(int paramInt, String paramString1, String paramString2) {
        return getHtmlSpanned(paramInt, paramString1, paramString2, "#333333");
    }

    /*----------设置黑色字体、加大-----------------*/
    public static Spanned getHtmlBlackBigSpanned(String paramString) {
        return getHtmlSpannedBig(paramString, "#333333");
    }

    public static Spanned getHtmlBlackBigSpanned(int paramInt, String paramString) {
        return getHtmlSpannedBig(paramInt, paramString, "#333333");
    }

    public static Spanned getHtmlBlackBigSpanned(int paramInt, String paramString1, String paramString2) {
        return getHtmlSpannedBig(paramInt, paramString1, paramString2, "#333333");
    }

    /*----------设置黑色字体、加大、加粗-----------------*/
    public static Spanned getHtmlBlackBigStrongSpanned(int paramInt, String paramString) {
        return getHtmlSpannedBigStrong(paramInt, paramString, "#333333");
    }

    public static Spanned getHtmlBlackBigStrongSpanned(int paramInt, String paramString1, String paramString2) {
        return getHtmlSpannedBigStrong(paramInt, paramString1, paramString2, "#333333");
    }

    public static Spanned getHtmlBlackBigBigStrongSpanned(int paramInt, String paramString) {
        return getHtmlSpannedBigBStrong(paramInt, paramString, "#333333");
    }

    public static Spanned getHtmlBlackBigBigStrongSpanned(int paramInt, String paramString1, String paramString2) {
        return getHtmlSpannedBigBStrong(paramInt, paramString1, paramString2, "#333333");
    }

    /*--------------设置文字、颜色------------------------*/
    public static Spanned getHtmlSpanned(String paramString, String colorValue) {
        return Html.fromHtml("<font color='" + colorValue + "'>" + paramString + "</font>");
    }

    public static Spanned getHtmlSpanned(int paramInt, String paramString, String colorValue) {
        return Html.fromHtml(String.format(getTextString(paramInt,
                "<font color='" + colorValue + "'>" + paramString + "</font>")));
    }

    public static Spanned getHtmlSpanned(int paramInt, String paramString1, String paramString2, String colorValue) {
        return Html.fromHtml(String.format(getTextString(paramInt,
                "<font color='" + colorValue + "'>" + paramString1 + "</font>",
                "<font color='" + colorValue + "'>" + paramString2 + "</font>")));
    }

    /*--------------设置文字、颜色、加大------------------------*/
    public static String getHtmlFormatBigStrong(String paramString) {
        return getHtmlFormatBigStrong(paramString, "#333333");
    }

    public static String getHtmlFormatBigStrong(String paramString, String colorValue) {
        String str = String.format("<strong><font color='" + colorValue + "'><big>" + paramString + "</big></font></strong>");
        return str;
    }

    public static Spanned getHtmlSpannedBig(String paramString, String colorValue) {
        String str = String.format("<font color='" + colorValue + "'><big>" + paramString + "</big></font>");
        return Html.fromHtml(str);
    }

    public static Spanned getHtmlSpannedBig(int paramInt, String paramString, String colorValue) {
        String str = String.format(getTextString(paramInt,
                "<font color='" + colorValue + "'><big>" + paramString + "</big></font>"));
        return Html.fromHtml(str);
    }

    public static Spanned getHtmlSpannedBig(int paramInt, String paramString1, String paramString2, String colorValue) {
        String str = String.format(getTextString(paramInt,
                "<font color='" + colorValue + "'><big>" + paramString1 + "</big></font>",
                "<font color='" + colorValue + "'><big>" + paramString2 + "</big></font>"));
        return Html.fromHtml(str);
    }

    /*--------------设置文字、颜色、加大、加粗------------------------*/
    public static Spanned getHtmlSpannedBigStrong(int paramInt, String paramString, String colorValue) {
        String str = String.format(getTextString(paramInt,
                "<strong><font color='" + colorValue + "'><big>" + paramString + "</big></font></strong>"));
        return Html.fromHtml(str);
    }

    public static Spanned getHtmlSpannedBigStrong(int paramInt, String paramString1, String paramString2, String colorValue) {
        String str = String.format(getTextString(paramInt,
                "<strong><font color='" + colorValue + "'><big>" + paramString1 + "</big></font></strong>",
                "<strong><font color='" + colorValue + "'><big>" + paramString2 + "</big></font></strong>"));
        return Html.fromHtml(str);
    }


    public static Spanned getHtmlBlackBigSmailStrongSpanned(int paramInt, String paramString1, String paramString2) {
        return getHtmlSpannedBigSmailStrong(paramInt, paramString1, paramString2, "#333333");
    }

    public static Spanned getHtmlSpannedBigSmailStrong(int paramInt, String paramString1, String paramString2, String colorValue) {
        String str = String.format(getTextString(paramInt,
                "<strong><font color='" + colorValue + "'><big>" + paramString1 + "</big></font></strong>",
                paramString2));
        return Html.fromHtml(str);
    }

    public static Spanned getHtmlSpannedBigBigStrong(int paramInt, String paramString1, String paramString2) {
        String str = String.format(getTextString(paramInt,
                "<strong><font> <big><big>" + paramString1 + "</big></big> </font></strong>",
                "<strong><font> <big><big>" + paramString2 + "</big></big> </font></strong>"));
        return Html.fromHtml(str);
    }

    //双倍加大、加粗
    public static Spanned getHtmlSpannedBigBStrong(int paramInt, String paramString, String colorValue) {
        String str = String.format(getTextString(paramInt,
                "<strong><font color='" + colorValue + "'><big><big>" + paramString + "</big></big></font></strong>"));
        return Html.fromHtml(str);
    }

    public static Spanned getHtmlSpannedBigBStrong(int paramInt, String paramString1, String paramString2, String colorValue) {
        String str = String.format(getTextString(paramInt,
                "<strong><font color='" + colorValue + "'><big><big>" + paramString1 + "</big></big></font></strong>",
                "<strong><font color='" + colorValue + "'><big><big>" + paramString2 + "</big></big></font></strong>"));
        return Html.fromHtml(str);
    }


    /*-----------------组装完整的字符串-------------------------------------*/
    public static String getTextString(int paramInt, String paramString1, String paramString2) {
        return getTextString(BaseApplication.getApplication(), paramInt, paramString1, paramString2);
    }

    public static String getTextString(Context context, int paramInt, String paramString1, String paramString2) {
        Object[] arrayOfObject = new Object[2];
        arrayOfObject[0] = paramString1;
        arrayOfObject[1] = paramString2;
        return context.getResources().getString(paramInt, arrayOfObject);
    }

    public static String getTextString(int paramInt, String paramString1) {
        return getTextString(BaseApplication.getApplication(), paramInt, paramString1);
    }

    public static String getTextString(Context context, int paramInt, String paramString1) {
        Object[] arrayOfObject = new Object[1];
        arrayOfObject[0] = paramString1;
        return context.getResources().getString(paramInt, arrayOfObject);
    }
}